//
//  CLShareButton.m
//  chanlin
//
//  Created by shuhui on 15-7-3.
//  Copyright (c) 2015年 chanlin. All rights reserved.
//

#import "CLShareButton.h"

@implementation CLShareButton


- (id)initWithTitle:(NSString*)title andIcon:(UIImage*)icon{
    self = [super init];
    if (self) {
        _iconView = [UIImageView new];
        _iconView.frame = CGRectMake(13.5, 0, 50, 50);
        _iconView.backgroundColor = [UIColor clearColor];
        _iconView.image = icon;
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 66, 79, 13)];
        _titleLabel.backgroundColor = [UIColor clearColor];
        _titleLabel.text = title;
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        _titleLabel.font= [UIFont systemFontOfSize:13.f];
        _titleLabel.textColor = RGB(0xcc, 0xcc, 0xcc);
        [self addSubview:_titleLabel];
        [self addSubview:_iconView];
    }
    return self;
}

- (void)setFrame:(CGRect)frame
{
    [super setFrame:frame];
    _iconView.frame = CGRectMake(13.5, 5, 50, 50);
    _titleLabel.frame = CGRectMake(0, 66, 79, 13);
}

@end
